package com.hqyj.controller;

import com.hqyj.dao.StudentMapper;
import com.hqyj.pojo.Student;
import com.hqyj.pojo.User;
import com.hqyj.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;

/**
 * <p></p>
 *
 * @author : wwy
 * @date : 2020-09-03 09:09
 **/
@Controller
@RequestMapping("student")
public class StudentController {
@Autowired
    StudentService studentService;

    @RequestMapping("studentList")
    public String roomList(){return "student/studentinfo";}
    //新增
    @RequestMapping("add")
    @ResponseBody
    public HashMap<String,Object> add(Student student){
        return studentService.add(student);
    }
    //修改
    @RequestMapping("update")
    @ResponseBody
    public HashMap<String,Object> update(Student student){
        return studentService.update(student);
    }
    //删除
    @RequestMapping("del")
    @ResponseBody
    public HashMap<String,Object> del(Integer id){
        return studentService.del(id);
    }
    //查询
    @RequestMapping("select")
    @ResponseBody
    public HashMap<String,Object> select(Student student){
        return (HashMap<String, Object>) studentService.select(student);
    }
}
